<?php
session_start();

include 'koneksi.php';

$email =$_POST['email'];
$password =$_POST['password'];

$query = mysql_query("SELECT * FROM user
WHERE EMAIL='$email'");
$data = mysql_fetch_array($query);

if ($password == $data['PASSWORD'])
{
// menyimpan username dan role ke dalam session
	$_SESSION['role'] = $data['ROLE'];
	$_SESSION['email'] = $data['EMAIL'];
// tampilkan menu
include "auth.php";
}
  else
echo "<script>alert('Wrong Email and Password!');
  javascript:history.go(-1);</script>";
?>